package lift;

import java.util.ArrayList;

public class Main {
	private static LiftView liftView;
	private static LiftMonitor monitor;
	public static void main(String[] args){
		liftView = new LiftView();
		 monitor = new LiftMonitor(liftView);
		ArrayList<PersonThread> personas = new ArrayList<PersonThread>();
		for (int i = 0; i < 20 ; i ++){
			PersonThread newPerson = new PersonThread(monitor);
			personas.add(newPerson);
			newPerson.start();
			
		}
		int current = 0;
		
		while(true){
			/*moveToFloor(0, 1);
			moveToFloor(1, 2);
			moveToFloor(2, 3);
			moveToFloor(3, 4);
			moveToFloor(4, 5);
			moveToFloor(5, 6);
			moveToFloor(6, 5);
			moveToFloor(5, 4);
			moveToFloor(4, 3);
			moveToFloor(3, 2);
			moveToFloor(2, 1);
			moveToFloor(1, 0);*/
			int nextFloor = monitor.getNextFloor();
			moveToFloor(current, nextFloor);
			current = nextFloor;
		}
		
		
		//liftView.drawLevel(3, 2);
		//liftView.drawLift(3, 2);
		//l/iftView.drawLift(3, 1);
	}
	
	private static void moveToFloor(int from, int to){
		monitor.goToFloor(to);
		liftView.moveLift(from, to);
		monitor.arrivedAtFloor(to);
		
	}

}
